<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title>程序猿的小本本 </title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">


<meta name="description" content="光说有毛用|程序猿的小本本" />

<meta name="keywords" content="">


<meta property="og:title" content="程序猿的小本本 ">
<meta property="og:site_name" content="程序猿的小本本"/>
<meta property="og:url" content="http://replace-this-with-your-hugo-site.com/" />
<meta property="og:locale" content="en-us">


<meta property="og:type" content="website" />



<link href="http://replace-this-with-your-hugo-site.com/index.xml" rel="alternate" type="application/rss+xml" title="程序猿的小本本" />

<link rel="canonical" href="http://replace-this-with-your-hugo-site.com/" />

<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://replace-this-with-your-hugo-site.com/touch-icon-144-precomposed.png">
<link href="http://replace-this-with-your-hugo-site.com/favicon.png" rel="icon">
<meta name="theme-color" content="#2053AB">
<meta name="generator" content="Hugo 0.17-DEV" />

  <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<link href='https://fonts.googleapis.com/css?family=Merriweather:300%7CRaleway%7COpen+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://replace-this-with-your-hugo-site.com/css/font-awesome.min.css">
<link rel="stylesheet" href="http://replace-this-with-your-hugo-site.com/css/style.css">
<link rel="stylesheet" href="http://replace-this-with-your-hugo-site.com/css/highlight/default.css">

  
</head>
<body>
  <main id="main-wrapper" class="container main_wrapper has-sidebar">
    <header id="main-header" class="container main_header">
  <div class="container brand">
  <div class="container title h1-like">
  <a class="baselink" href="http://replace-this-with-your-hugo-site.com/">
  程序猿的小本本

</a>

</div>

  
<div class="container topline">
  
  光说有毛用


</div>


</div>

  <nav class="container nav primary no-print">
  

<a class="homelink" href="http://replace-this-with-your-hugo-site.com/">Home</a>


  
<a href="http://replace-this-with-your-hugo-site.com/about">About</a>

<a href="http://replace-this-with-your-hugo-site.com/post" title="Show list of posts">Posts</a>

<a href="http://replace-this-with-your-hugo-site.com/tags" title="Show list of tags">Tags</a>


</nav>

<div class="container nav secondary no-print">
  
<a id="contact-link-email" class="contact_link" href="mailto:chennqqi@qq.com">
  <span class="fa fa-envelope-square"></span><span>email</span></a>



<a id="contact-link-github" class="contact_link" href="https://github.com/chennqqi?tab=repositories">
  <span class="fa fa-github-square"></span><span>github</span></a>

















</div>


  

</header>


<section id="main-content" class="container main_content homepage">
  <header class="container header">
    <h1>程序猿的小本本
</h1>

    <span>last update: <time datetime="2016-01-11T14:48:49Z">11 January at 2:48pm</time>
</span>

  </header>
  
  
    <article class="container content summary">
  <div class="container hat">
  <h2><a href="http://replace-this-with-your-hugo-site.com/2015/10/15/wildcard_match.html">C语言通配符匹配
</a>
</h2>

  <time datetime="2015-10-15">15 Oct, 2015</time>

</div>

  <p class="container content">
  
  
    C语言通配符匹配 工作中经常会遇到通配符，windows控制台程序，linux shell，还有web服务器配置路径，Makefile中。 我来分享两个C语言通配符匹配程序和测试程序；我是抱着拿来主义的想法，年纪大了越越懒得动脑子了。 通配符程序中用到的是*和? *表示任意多个任意字符 ?表示单个任意字符 关于通配符的定义引用百度百科的一段话 通配符是一种特殊语句，主要有星号(*)和问号(?)，用来模糊搜索文件。当查找文件夹时，可以使用它来代替一个或多个真正字符；当不知道真正字符或者懒得输入完整名字时，常常使用通配符代替一个或多个真正的字符。 实际上用&#8221;*Not?paOd&#8221;可以对应Notpad\MyNotpad【*可以代表任何文字】;Notpad\Notepad【?仅代表单个字】;Notepad\Notepod【ao代表a与o里二选一】，其余以此类推。 第一个程序是商业友好的license，请放心使用！ License This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below. A list of licenses authors might use can be found here 第二个没有明确标明。 &nbsp; 两个程序是类似的，第一个程序用的是循环，第二个程序用的是递归。 static int wildcmp(const char* wild, const char* pattern) { // Written by Jack Handy - &lt;A href="mailto:jakkhandy@hotmail.com"&gt;jakkhandy@hotmail.com&lt;/A&gt; const char *cp = NULL, *mp = NULL; while ((*pattern) && (*wild != '*')) { if ((*wild != *pattern) && (*wild != '?')) { return 0; } wild++; pattern++; } while (*pattern) { if (*wild == '*') { if (!*++wild) { return 1; } mp = wild; cp = pattern + 1; } else if ((*wild == *pattern) || (*wild == '?')) { wild++; pattern++; } else { wild = mp; pattern = cp++; } } while (*wild == '*') { wild++; } return !*wild; } // The main function that checks if two given strings match.
  


</p>


  <div class="container readlink">
  <a href="http://replace-this-with-your-hugo-site.com/2015/10/15/wildcard_match.html">Read more &rarr;</a>

</div>


</article>

  
    <article class="container content summary">
  <div class="container hat">
  <h2><a href="http://replace-this-with-your-hugo-site.com/2015/10/13/libtcmalloc-so-4-linkerror.html">libtcmalloc.so.4 链接失败
</a>
</h2>

  <time datetime="2015-10-13">13 Oct, 2015</time>

</div>

  <p class="container content">
  
  
    error while loading shared libraries: libtcmalloc.so.4: cannot open shared object file: No such file or directory 楼主在安装lnmp时，开启了tmalloc优化，结果在安装过程中报了如上错误； 解决办法： 用locate命令或者find命令查找确认该文件确实存在的路径； 将路径加载到ld的配置中，命令就一句(root权限) echo /usr/local/lib &gt; /etc/ld.so.conf.d/libtcmalloc.conf 楼主的文件位于/usr/local/lib 来自 &lt;http://www.th7.cn/Program/cp/201310/154663.shtml&gt;
  


</p>


  <div class="container readlink">
  <a href="http://replace-this-with-your-hugo-site.com/2015/10/13/libtcmalloc-so-4-linkerror.html">Read more &rarr;</a>

</div>


</article>

  
    <article class="container content summary">
  <div class="container hat">
  <h2><a href="http://replace-this-with-your-hugo-site.com/2015/10/10/centos6-update-nginx.html">centos6 升级nginx
</a>
</h2>

  <time datetime="2015-10-10">10 Oct, 2015</time>

</div>

  <p class="container content">
  
  
    centos6 默认源的nginx版本很低，网上给出的大部分方法下载源码编译安装； 这种方法比较麻烦，其实最简单的方法是使用nginx官网的源进行安装； 进入 /etc/yum.repos.d/ 目录下生成nginx的源配置 cd /etc/yum.repos.d/ 用vi/vim/cat 工具生成nginx.repo填入以下内容 [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1 安装 yum install -y nginx 更新 yum update nginx 参考:http://my.oschina.net/VincentJiang/blog/224993 https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
  


</p>


  <div class="container readlink">
  <a href="http://replace-this-with-your-hugo-site.com/2015/10/10/centos6-update-nginx.html">Read more &rarr;</a>

</div>


</article>

  
    <article class="container content summary">
  <div class="container hat">
  <h2><a href="http://replace-this-with-your-hugo-site.com/2015/10/10/dota_story.html">关于dota的一个悲伤故事
</a>
</h2>

  <time datetime="2015-10-10">10 Oct, 2015</time>

</div>

  <p class="container content">
  
  
    悲伤的故事。。 这么多年单身原来是因为我dota打的菜。彩笔是不配拥有爱情的&#8230;
  


</p>


  <div class="container readlink">
  <a href="http://replace-this-with-your-hugo-site.com/2015/10/10/dota_story.html">Read more &rarr;</a>

</div>


</article>

  
  
<div class="container pagination">
  


<a aria-label="First" href="http://replace-this-with-your-hugo-site.com//">
  <span aria-hidden="true">««</span>
</a>

<a aria-label="Previous" href="http://replace-this-with-your-hugo-site.com//page/4/">
  <span aria-hidden="true">«</span>
</a>


<a href="http://replace-this-with-your-hugo-site.com//">
  1
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/2/">
  2
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/3/">
  3
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/4/">
  4
</a>

<a class="active" href="http://replace-this-with-your-hugo-site.com//page/5/">
  5
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/6/">
  6
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/7/">
  7
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/8/">
  8
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/9/">
  9
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/10/">
  10
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/11/">
  11
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/12/">
  12
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/13/">
  13
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/14/">
  14
</a>

<a href="http://replace-this-with-your-hugo-site.com//page/15/">
  15
</a>


<a aria-label="Next" href="http://replace-this-with-your-hugo-site.com//page/6/">
  <span aria-hidden="true">»</span>
</a>

<a aria-label="Last" href="http://replace-this-with-your-hugo-site.com//page/15/">
  <span aria-hidden="true">»»</span>
</a>


</div>


</section>

      <footer id="main-footer" class="container main_footer">
  

  <div class="container nav foot no-print">
  

  <a class="toplink" href="#">back to top</a>

</div>

  <div class="container credits">
  
<div class="container footline">
  
  code with <i class='fa fa-heart'></i>


</div>


  
<div class="container copyright">
  
  &copy; 2016 gsymy.com.


</div>


</div>

</footer>

    </main>
    
<script type="text/javascript">
  (function() {
    
    
    if (window.location.hostname == "localhost")
      return;

    var dsq = document.createElement('script'); dsq.async = true; dsq.type = 'text/javascript';
    dsq.src = '//your_disqus_shortname.disqus.com/count.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();
</script>



<script src="http://replace-this-with-your-hugo-site.com/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>



<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'Your Google Analytics tracking code', 'auto');
  ga('send', 'pageview');

</script>


    
  </body>
</html>

